package com.org.listen;

import com.org.entity.Poem;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * @author Rainy-Heights
 * @version 1.0
 * @Date 2023/3/5 14:35
 */
@Component
public class Listener implements ApplicationListener< ContextRefreshedEvent > {
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        ApplicationContext context=event.getApplicationContext();
        System.out.println(context.getBean(Poem.class));
    }
}
